<?php require_once('../Connections/conexao.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_conexao, $conexao);
$query_concategorias = "SELECT * FROM categorias ORDER BY id_categoria ASC";
$concategorias = mysql_query($query_concategorias, $conexao) or die(mysql_error());
$row_concategorias = mysql_fetch_assoc($concategorias);
$totalRows_concategorias = mysql_num_rows($concategorias);
?>
<!doctype html>

<!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
<!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
<!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>categoria</title>
<link href="CSS ADMIN/boilerplate.css" rel="stylesheet" type="text/css">
<link href="CSS ADMIN/TEMPLAITE.css" rel="stylesheet" type="text/css">
<!-- 
Para saber mais sobre os comentários condicionais sobre as tags html na parte superior do arquivo:
paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/

Se você estiver usando a compilação personalizada do modernizr (http://www.modernizr.com/), faça o seguinte:
* insira o link para o seu js aqui
* remova o link abaixo para o html5shiv
* adicione a classe "no-js" às tags html na parte superior
* você também pode remover o link para respond.min.js se tiver incluído o MQ Polyfill na sua compilação do modernizr 
-->
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="js/respond.min.js"></script>
</head>
<body>
<div class="gridContainer clearfix">
  <div id="LayoutDiv1">
  <table width="960" align="center">
  <tr>
    <td colspan="2">
	<?php
	include ("../temadmin/cabecalho.php");
	?>
    </td>
  </tr>
  <tr>
    <td colspan="2">
	<?php
	include "../temadmin/menu_vertical.php";
	?>
    </td>
  </tr>
  <tr>
    <td width="250">
	<?php
	include "../temadmin/menu.php";
	?>
    </td>
    <td width="698">
    	<table width="100%">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
  
    <div align="center"><strong>
    <h3><p>Categorias
    </p>
    </h3>
    </strong>
    </div>
   
			
    
   
    <table width="99%" border="1" align="center" cellpadding="1" bordercolor="#000000">
  <tr>
    <td width="17%" bgcolor="#999999" bordercolor="#000000"><strong>id</strong></td>
    <td width="75%" bgcolor="#999999" bordercolor="#000000"><strong>Categorias</strong></td>
    <td colspan="2" bgcolor="#999999" bordercolor="#000000"><strong>Ação</strong></td>
  </tr>
  
 
    <?php do { ?>
      <tr>
        
        <td bgcolor="#D6D6D6" bordercolor="#000000"><?php echo $row_concategorias['id_categoria']; ?></td>
        <td bgcolor="#D6D6D6" bordercolor="#000000"><?php echo $row_concategorias['categoria']; ?></td>
        <td width="4%" bgcolor="#D6D6D6" bordercolor="#000000"><a href="categoria-editar.php?idcategoria=<?php echo $row_concategorias['id_categoria']; ?>"><img src="img/Editar.png"></a></td>
        <td width="4%" bordercolor="#000000" bgcolor="#D6D6D6"><a href="categoria-excluir.php?idcategoria=<?php echo $row_concategorias['id_categoria']; ?>"><img src="img/Excluir.png"></a></td>
      </tr>
      <?php } while ($row_concategorias = mysql_fetch_assoc($concategorias)); ?>
   
 
      
  
  <tr>
    <td colspan="4" align="right" bgcolor="#999999" bordercolor="#000000"><a href="categoria-inserir.php"><img src="img/inserir.png"></a></a></td>
</tr>
</table>
  

    
    
    
    </td>
  </tr>
</table>

    </td>
  </tr>
  <tr>
    <td colspan="2">
	<?php
	include ("../temadmin/rodape.php");
	?>
<?php
mysql_free_result($concategorias);
?>
</td>
  </tr>
</table>
  </div>
</div>
</body>
</html>
